home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d19
/
cntm095b.arc
/
COUNTEM.DOC
< prev
next >
Wrap
Text File
|
1991-10-03
|
13KB
|
377 lines
╓─────╖ ╥─────╖
║ ║
║ ╓──╖ ╥ ╥ ╓─╖ ╥ ╓─╥─╖ ╟── ╓─╥─╖ ║
║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║ ║
╙─────╜ ╙──╜ ╙──╜ ╨ ╙─╜ ╨ ╨─────╜ ╨ ╨ ╨ o
Version 0.95ß
PCBoard 14.5a Directory Header Generator
Copyright 1991 by Michael Nelson
Sysop of SeaHunt BBS
FidoNet 1:125/20 and RBBSNet 8:914/501
October 3, 1991
CountEm started as a utility to generate summaries of your
downloadable files directories. With the release of version 0.95ß,
CountEm will also produce graphic header files for the individual DIR
files. Written in Borland C, CountEm is VERY fast!! On my system (a
386/33 with 2 megs of HyperDisk Cache, over 3200 files totalling over
240 megs), CountEm does all this in approximately six seconds!
CountEm uses a small configuration file to allow you to personalize
the colors and the way your BBS's name is displayed in the headers. It
gets most of the information it needs, however, directly from PCBoard's
system files PCBOARD.DAT, CNAMES.@@@, and DIR.LST. In doing this,
several assumptions are made:
1) Although CountEm opens the PCBoard system files in SHARE
compatible mode, and CountEm does not write to any system files except
the DIR files themselves, you should still make sure all nodes are DOWN
prior to running CountEm. If a caller is on and that caller is reading
a DIR file when CountEm attempts to write to it, you'll get a SHARE
violation, (assuming you have SHARE.EXE loaded). If you DON'T have
SHARE loaded, bad things could happen. So, the moral of the story is,
make sure all nodes are DOWN prior to running CountEm.
2) There isn't much error checking on the COUNTEM.CFG file. An
example COUNTEM.CFG file is included in this archive. Please modify it
to suit your needs. As long as you use an ASCII text file editor
(QEdit works fine, I use Brief and MultiEdit), and don't do stupid
things like putting in a 255 character name for your BBS, nothing
should go wrong. Make SURE the format of your finished file is the
same as in the example file.
3) When changing the colors, please make sure you use VALID PCBoard
14.5 color codes. If you don't, the program will, most likely,
misbehave. There is NO error checking on the color codes. If you put
in valid codes, you'll get valid colors. On the next page of this
document is an excerpt from Clark Development Corp's bulletin "X-CODES"
(available from SaltAir), showing the valid color codes.
-=- PCBoard Color Codes -=-
The @x-color codes correspond to your regular PC display codes.
For instance, a 1 is blue, a 2 is green a 3 is cyan and so on.
The same numbers are used for background colors except that they
are shifted left four bits (to the upper "nibble" of the byte if that
means anything to you). It's easy to picture when you think of it in
HEX rather than decimal numbers like this:
Background (first digit) Foreground (second digit)
------------------------ -------------------------
Black = 0 Black = 0
Blue = 1 Blue = 1
Green = 2 Green = 2
Cyan = 3 Cyan = 3
Red = 4 Red = 4
Magenta = 5 Magenta = 5
Yellow = 6 Yellow = 6
White = 7 White = 7
Background w/Blinking High Intensity Foregounds
Black = 8 Black = 8
Blue = 9 Blue = 9
Green = A Green = A
Cyan = B Cyan = B
Red = C Red = C
Magenta = D Magenta = D
Yellow = E Yellow = E
White = F White = F
Examples:
Bright White on Blue Background = 1F (1=blue,F=white)
Bright Yellow on Green Background = 2E (2=green,E=yellow)
Dark Blue blinking on White Background = F1 (F=white,1=blue)
See how the number in the left colomn represents the background
while the number in the right column represents the foreground? That
is a whole lot easier to remember than to think of "blue background"
being equal to 16, "green background" equal to 32 and "cyan background"
equal to 48 which is what you'd have in decimal.
Combining colors then is much easier to visualize as well - for
instance YELLOW foreground on a BLUE background would be:
1E - where 1=BLUE and E=bright yellow
Instead of thinking of yellow on blue as being the number 30 which
doesn't make any sense at all.
Okay, now to practice what we've learned:
@X00
@x1E = @X1EYELLOW ON BLUE@XFF
@x2F = @X2FWHITE ON GREEN@XFF
@x31 = @X31BLUE ON CYAN@XFF
The COUNTEM.CFG file:
---------------------
The format of COUNTEM.CFG is critical to your success in running
the program. Here's what a sample COUNTEM.CFG looks like:
C:\PCB
S e a H u n t B B S
@X06
@X0D
@X0F
@X0B
@X07
@X0E
@X0E
@X0F
@X03
@X0B
@X03
;------------------------------------------------------------------
; CountEm Configuration File
; for CountEm v0.95ß
;
; Notes:
; You can put comments in this file, as long as they are below the
; dashed line above, and as long as they have a semicolon in column
; number 1.
;
; There should be NO BLANK LINES in this file
;
; CountEm v0.92ß requires the addition of line 13!!
;
;
; Line 1: Path to PCBOARD.DAT file (no trailing backslash, pls!!)
; Line 2: BBS Name for DIR header
; Line 3: Line drawing character color
; Line 4: BBS Name color
; Line 5: DIR Title color
; Line 6: Header color
; Line 7: Normal color (default is X07, light grey on black)
; Line 8: Directory Number color
; Line 9: Conference Name color
; Line 10: Directory Description color
; Line 11: File Count Color
; Line 12: File Size Color
; Line 13: TimeStamp Color (NEW in v0.92ß)
Preparing to use CountEm:
-------------------------
After modifying COUNTEM.CFG, you'll need to use either PCBFILER.EXE
or an ASCII text editor to modify your DIRn files. With the
introduction of PCBoard 14.5A, Clark Development Corporation (CDC) has
given PCBoard the capability to display a file from within another
file. This is the method CountEm uses to display the directory header
files.
Break out your editor, and let's go to work on your DIRn files.
First, you need to determine where they are located. The default
PCBoard setup program puts them in C:\PCB\GEN. If you don't know where
they are located, you can find them by using PCBSetup.
Once you've found them, load them, one by one, into your editor or
PCBFiler. We'll use my DIR12 file as an example. You need to trim any
lines above the first filename line off, and insert a line that says
something like:
%c:\pcb\gen\dir12.hdr
The above line is what you would add as the first line of your
DIR12 file. The header file generated by CountEm is DIR12.HDR. You
need to have this line at the top of each DIR file, as line 1, and it
needs to start in column one. When PCBoard goes to display DIR12, the
first thing it sees is "%c:\pcb\gen\dir12.hdr". That tells it to
display that filename BEFORE displaying DIR12. Don't forget to put it
as the FIRST line of the DIR file, and make sure the "%" character is
there in column 1.
There should NOT be a blank line below the above line. After
editing DIR12, the first two lines of the file will look something like
this:
%c:\pcb\gen\dir12.hdr
24UP.ZIP 42452 01-18-91 Compressed file printing with HP LJII
You'll need to do this just once for each DIRn file on your system.
I realize it's a pain, but CountEm won't work right without this step!!
Running CountEm:
----------------
Don't worry... if you've gotten this far, you're almost done!
Running CountEm is simple. You can run it from the DOS prompt (make
sure all nodes are down first), by changing into the directory where
CountEm.exe and CountEm.cfg are located (BTW, they need to be in the
same directory... I just put 'em in C:\PCB), and then typing:
COUNTEM COUNTEM.CFG
ErrorLevels:
------------
To make usage in batch files more convenient, CountEm will exit
with various different "errorlevels". An errorlevel of "0" indicates
that the program exited normally. Any other errorlevel returned by the
program indicates a problem of one sort or another. The errorlevels
returned by CountEm are:
99 = Error Opening a File
98 = Syntax Error - Bad Command Line
97 = Error Closing a File
96 = Error Reading a File
95 = Too Many Conferences to Process
94 = Too Many Directories to Process
93 = Unable to Allocate Required Memory
0 = Normal Exit
So, you can trap these errorlevels in a batch file and take
appropriate action if something goes wrong. Proper trapping of
errorlevels in your batch file should help you sleep better at night!
There's a sample batch file you might call CNT.BAT on the next page.
Remember that you need to check errorlevels in descending order. A
typical batch file to run CountEm in your event might look like this:
@ECHO OFF
C:
CD\PCB
COUNTEM COUNTEM.CFG
IF ERRORLEVEL 99 GOTO FILE
IF ERRORLEVEL 98 GOTO COMMAND
IF ERRORLEVEL 97 GOTO CLOSE
IF ERRORLEVEL 96 GOTO READ
IF ERRORLEVEL 95 GOTO CONF
IF ERRORLEVEL 94 GOTO DIRS
IF ERRORLEVEL 93 GOTO MEM
IF ERRORLEVEL 0 GOTO NORM
:FILE
ECHO COUNTEM UNABLE TO OPEN FILE! > COUNTEM.LOG
GOTO END
:COMMAND
ECHO COUNTEM SYNTAX ERROR! > COUNTEM.LOG
GOTO END
:CLOSE
ECHO COUNTEM WAS UNABLE TO CLOSE A FILE! > COUNTEM.LOG
GOTO END
:READ
ECHO COUNTEM WAS UNABLE TO READ A FILE! > COUNTEM.LOG
GOTO END
:CONF
ECHO COUNTEM REPORTED TOO MANY CONFERENCES! > COUNTEM.LOG
GOTO END
:DIRS
ECHO COUNTEM REPORTED TOO MANY DIRECTORIES! > COUNTEM.LOG
GOTO END
:MEM
ECHO COUNTEM REPORTED MEMORY ALLOCATION ERROR! > COUNTEM.LOG
GOTO END
:NORM
ECHO COUNTEM PROCESSING FINISHED NORMALLY > COUNTEM.LOG
:END
Disclaimer:
-----------
This program is not guaranteed to do anything but occupy a bit of
space on your hard drive. While it has been tested on several PCBoard
systems, Michael Nelson can not be held responsible for any damage
CountEm may do to your system.
If you can't live with the risk, delete the program, please.
Tech Support:
-------------
If you have any problems, or any suggestions for improvements, you
can contact me in several ways.
1) I monitor most conferences on SaltAir BBS, so if you leave me a
message there I will probably see it and respond to you.
2) If you are in FidoNet or RBBSNet, you can send me NetMail at
either of the following addresses:
FidoNet 1:125/20
RBBSNet 8:914/501
3) You can log onto my BBS and leave me a message. SeaHunt BBS is
located in Burlingame, California (near San Francisco), and is PC
Pursuitable. There are two nodes:
Node 1 - PRIVATE / SUBSCRIBERS 1-415-343-5904
USR HST/DS v.32bis modem
Node 2 - PUBLIC 1-415-344-4348
USR HST 14.4k modem
Release History:
----------------
9/29/91 v0.91ß Initial wide beta release
9/30/91 v0.92ß Additional error checking. Changed configuration
file. Added a timestamp to the header.
10/1/91 v0.93ß Not released
10/3/92 v0.94ß CountEm was not properly counting lines in
instances where there was a header
containing line drawing characters embedded in the
DIRn files. Fixed.
10/3/92 v0.95ß Added the ability for CountEm to generate graphical
header files for each of your DIRn files.
Optimized several areas of the code, and now
CountEm does this additional work in no more time
than previous versions took to just do the summaries.